package com.muyu.system.service.impl;

import java.util.List;
import com.muyu.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.muyu.system.mapper.DmShoppingCommentMapper;
import com.muyu.system.domain.DmShoppingComment;
import com.muyu.system.service.IDmShoppingCommentService;

/**
 * 商品评价Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-18
 */
@Service
public class DmShoppingCommentServiceImpl implements IDmShoppingCommentService 
{
    @Autowired
    private DmShoppingCommentMapper dmShoppingCommentMapper;

    /**
     * 查询商品评价
     * 
     * @param id 商品评价主键
     * @return 商品评价
     */
    @Override
    public DmShoppingComment selectDmShoppingCommentById(Long id)
    {
        return dmShoppingCommentMapper.selectDmShoppingCommentById(id);
    }

    /**
     * 查询商品评价列表
     * 
     * @param dmShoppingComment 商品评价
     * @return 商品评价
     */
    @Override
    public List<DmShoppingComment> selectDmShoppingCommentList(DmShoppingComment dmShoppingComment)
    {
        return dmShoppingCommentMapper.selectDmShoppingCommentList(dmShoppingComment);
    }

    /**
     * 新增商品评价
     * 
     * @param dmShoppingComment 商品评价
     * @return 结果
     */
    @Override
    public int insertDmShoppingComment(DmShoppingComment dmShoppingComment)
    {
        dmShoppingComment.setCreateTime(DateUtils.getNowDate());
        return dmShoppingCommentMapper.insertDmShoppingComment(dmShoppingComment);
    }

    /**
     * 修改商品评价
     * 
     * @param dmShoppingComment 商品评价
     * @return 结果
     */
    @Override
    public int updateDmShoppingComment(DmShoppingComment dmShoppingComment)
    {
        dmShoppingComment.setUpdateTime(DateUtils.getNowDate());
        return dmShoppingCommentMapper.updateDmShoppingComment(dmShoppingComment);
    }

    /**
     * 批量删除商品评价
     * 
     * @param ids 需要删除的商品评价主键
     * @return 结果
     */
    @Override
    public int deleteDmShoppingCommentByIds(Long[] ids)
    {
        return dmShoppingCommentMapper.deleteDmShoppingCommentByIds(ids);
    }

    /**
     * 删除商品评价信息
     * 
     * @param id 商品评价主键
     * @return 结果
     */
    @Override
    public int deleteDmShoppingCommentById(Long id)
    {
        return dmShoppingCommentMapper.deleteDmShoppingCommentById(id);
    }
}
